home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / cc02.zip / DEMO.C < prev    next >
Text File  |  1985-08-08  |  30KB  |  926 lines

  1. #define    foreground(A)    ((color_mon==1)?(A):(7))
  2.  
  3.  
  4.     int    u_row[14]={2,2,2,2,2,8,14,20,20,20,20,20,14,8};
  5.     int    u_col[14]={6,21,36,51,66,66,66,66,51,36,21,6,6,6};
  6.     int    l_row[14]={6,6,6,6,6,12,18,24,24,24,24,24,18,12};
  7.     int    l_col[14]={15,30,45,60,75,75,75,75,60,45,30,15,15,15};
  8.     int    wind[14];
  9.  
  10.     int    color_mon=0;
  11.  
  12.  
  13. main()
  14.  
  15. {
  16.  
  17.     int    temp,key,i,j,k,l;
  18.  
  19.     color(7,0);
  20.  
  21.     temp=open_window(9,15,13,61);
  22.  
  23.     locate(11,20);printf("Do you have a color monitor (Y/N) [ ]");
  24.     locate(11,55);
  25.     putch(key=getch());
  26.     if(key=='Y' || key=='y')color_mon=1;
  27.  
  28.     close_window(temp);
  29.  
  30.     color(foreground(1),0);
  31.     temp=open_window(3,5,23,75);
  32.     color_window(temp,foreground(14),0);
  33.     cls_window(temp);
  34.     print_window(temp,"╓─────────────────────────────────────────────── ▒▒▒▒█████\n");
  35.     print_window(temp,"║                            ░░░░░░              ███████▄\n");
  36.     print_window(temp,"║    ██   █   ██             ░____               ████O████\n");
  37.     print_window(temp,"║     ██ ███ ██                   ░              ▀▀▀▀▀▀▀▀▀\n");
  38.     print_window(temp,"║      ██   ██   I N D O W   ░░░░░░   O F T        │\n");
  39.     print_window(temp,"║                                                  │\n");
  40.     print_window(temp,"╚══════════╤══════════════════════════╤════════════╛\n");
  41.     print_window(temp,"           │   Fast - Small - Easy &  │   ╔════════════════════╗\n");
  42.     print_window(temp,"           │        C H E A P         │   ║  Glen Boyd         ║\n");
  43.     print_window(temp,"     ╔═════│                          │═══╣  21606 Criptana    ║\n");
  44.     print_window(temp,"     ║     │  W I N D O W S  For  'C' │   ║  Mission Viejo, CA ║\n"); 
  45.     print_window(temp,"     ║     │                          │   ║         92692      ║\n");
  46.     print_window(temp,"     ║     ╘══════════════════════════╛   ╚══╦═════════════════╝\n");
  47.     print_window(temp,"     ║                                       ║\n");
  48.     print_window(temp,"     ║ If you use these functions and find   ║\n");
  49.     print_window(temp,"     ║ them of value, a contribution of $30  ║\n");
  50.     print_window(temp,"     ║ would be greatly appreciated.         ║\n");
  51.     print_window(temp,"     ║                                       ║\n");
  52.     print_window(temp,"     ╚═══════════════════════════════════════╝");
  53.  
  54.     key=getch();
  55.  
  56.     close_window(temp);
  57.  
  58.  
  59.     for(i=0;i<=13;i++){
  60.  
  61.         color(foreground(i+1),0);
  62.         wind[i]=open_window(u_row[i],u_col[i],l_row[i],l_col[i]);
  63.  
  64.     }
  65.  
  66.     for(i=13;i>=0;i--){
  67.  
  68.         close_window(wind[i]);
  69.  
  70.     }
  71.  
  72.     for(i=13;i>=0;i--){
  73.  
  74.         color(foreground(i+1),0);
  75.         wind[i]=open_window(u_row[i],u_col[i],l_row[i],l_col[i]);
  76.  
  77.     }
  78.  
  79.     for(i=0;i<=13;i++){
  80.  
  81.         close_window(wind[i]);
  82.  
  83.     }
  84.  
  85.     for(i=0;i<14;i++){
  86.  
  87.         color(foreground(i+1),0);
  88.         wind[i]=open_window(u_row[i],u_col[i],l_row[i],l_col[i]);
  89.         color_window(wind[i],foreground(13),0);
  90.         print_window(wind[i],"C-WINDOWC-WINDOWC-WINDOW");
  91.         color_window(wind[i],foreground(i+1),0);
  92.  
  93.     }
  94.  
  95.  
  96.  
  97.  
  98.     subject(-1);
  99.  
  100.  
  101. /*  Move box 14 into place */
  102.  
  103.     for(i=15;i<=35;i++){
  104.  
  105.         move_window(wind[13],2);
  106.         slower();
  107.  
  108.     }
  109.     close_window(wind[13]);
  110.  
  111.  
  112.     subject(13);
  113.  
  114. /* Move box 13 into place */
  115.  
  116.     for(i=14;i>=11;i--){
  117.  
  118.         move_window(wind[12],1);
  119.         slower(13);
  120.  
  121.     }
  122.  
  123.     for(i=15;i<=40;i++){
  124.  
  125.         move_window(wind[12],2);
  126.         slower();
  127.  
  128.     }
  129.     close_window(wind[12]);
  130.  
  131.     subject(12);
  132.  
  133.  
  134. /* Move box 12 into place */
  135.  
  136.     for(i=11;i>=7;i--){
  137.  
  138.         for(j=u_col[i];j>6;j--){
  139.  
  140.             move_window(wind[i],4);
  141.             slower();
  142.         }
  143.  
  144.         for(j=u_row[i];j>11;j--){
  145.  
  146.             move_window(wind[i],1);
  147.             slower();
  148.         }
  149.  
  150.         l_col[i]=11;
  151.  
  152.         for(j=l_col[i];j<=35;j++){
  153.  
  154.             move_window(wind[i],2);
  155.             slower();
  156.         }
  157.  
  158.         close_window(wind[i]);
  159.  
  160.         subject(i);
  161.  
  162.     }
  163.  
  164.     for(i=6;i>=4;i--){
  165.  
  166.         for(j=l_row[i];j<24;j++){
  167.             move_window(wind[i],3);
  168.             slower();
  169.         }
  170.         l_row[i]=24;
  171.             
  172.  
  173.         for(j=u_col[i];j>6;j--){
  174.  
  175.             move_window(wind[i],4);
  176.             slower();
  177.         }
  178.         
  179.  
  180.         for(j=l_row[i];j>15;j--){
  181.  
  182.             move_window(wind[i],1);
  183.             slower();
  184.         }
  185.  
  186.         l_col[i]=6;
  187.  
  188.         for(j=l_col[i];j<=35;j++){
  189.  
  190.             move_window(wind[i],2);
  191.             slower();
  192.         }
  193.  
  194.         close_window(wind[i]);
  195.  
  196.         subject(i);
  197.  
  198.     }
  199.  
  200.  
  201.     for(i=3;i>=0;i--){
  202.  
  203.         for(j=l_col[i];j<75;j++){
  204.  
  205.             move_window(wind[i],2);
  206.             slower();
  207.         }
  208.  
  209.         l_col[i]=75;
  210.  
  211.  
  212.         for(j=l_row[i];j<24;j++){
  213.             move_window(wind[i],3);
  214.             slower();
  215.         }
  216.         l_row[i]=24;
  217.             
  218.  
  219.         for(j=l_col[i];j>15;j--){
  220.  
  221.             move_window(wind[i],4);
  222.             slower();
  223.         }
  224.  
  225.         for(j=l_row[i];j>15;j--){
  226.  
  227.             move_window(wind[i],1);
  228.             slower();
  229.         }
  230.  
  231.         l_col[i]=11;
  232.  
  233.         for(j=l_col[i];j<=35;j++){
  234.  
  235.             move_window(wind[i],2);
  236.             slower();
  237.         }
  238.  
  239.         close_window(wind[i]);
  240.  
  241.         subject(i);
  242.  
  243.     }
  244.  
  245.     subject(-2);
  246.  
  247. }
  248.  
  249. subject(wind)
  250.  
  251. int    wind;
  252.  
  253. {
  254.  
  255. static    int    temp,
  256.         temp2;
  257.     int    key,
  258.         wind1,
  259.         wind2,
  260.         wind3,
  261.         wind4,i,j;
  262.  
  263.     char    string[100];
  264.  
  265.     switch(wind){
  266.  
  267.  
  268.         case (-1):
  269.  
  270.             color(foreground(14),0);
  271.             temp2=open_window(8,17,18,64);
  272.             color_window(temp2,foreground(2),0);
  273.             print_window(temp2," C-WINDOWS is a comprehensive screen and");
  274.             print_window(temp2,"\n window handling package.  C-WINDOWS relieves");
  275.             print_window(temp2,"\n the programmer of handling extensive screen");
  276.             print_window(temp2,"\n and window manipulation.  C-WINDOWS is a");
  277.             print_window(temp2,"\n library of pre-written 'C' and ASSEMBLY");
  278.             print_window(temp2,"\n functions which do printing, coloring,");
  279.             print_window(temp2,"\n cursor positioning, and window handling.");
  280.             locate_window(temp2,9,9);
  281.             print_window(temp2,"Press any key to continue...");
  282.             color_window(temp2,foreground(14),0);
  283.             key=getch();
  284.  
  285.             break;
  286.  
  287.         case(13):
  288.  
  289.             color(foreground(14),0);
  290.             temp=open_window(4,9,23,73);
  291.             color_window(temp,foreground(2),0);
  292.  
  293.             print_window(temp," C-WINDOWS is supplied in a MS-DOS object library.  To obtain ");
  294.             print_window(temp,"\n the source for C-WINDOWS send a $30 contribution.  \n");
  295.  
  296.             print_window(temp,"\n C-WINDOWS provides you with a extensive set  of  pre-written ");
  297.             print_window(temp,"\n functions   for   manipulation  of  the  screen.   C-WINDOWS ");
  298.             print_window(temp,"\n provides functions for handling standard screen I/O such  as ");
  299.             print_window(temp,"\n printing, locating the cursor, setting color, scrolling part ");
  300.             print_window(temp,"\n of the screen, printing boxes, saving and restoring parts of ");
  301.             print_window(temp,"\n the  screen,  and  printing  horizontal and veritcal bars of ");
  302.             print_window(temp,"\n characters. \n");
  303.  
  304.             print_window(temp,"\n C-WINDOWS also contains a extensive  set  of  functions  for ");
  305.             print_window(temp,"\n handling  windows.  C-WINDOWS treats each seperate window as ");
  306.             print_window(temp,"\n a seperate virtual screen.  C-WINDOWS allows you to  scroll, ");
  307.             print_window(temp,"\n locate in,  color, blank, print in, move, open, close and re ");
  308.             print_window(temp,"\n activate each window by only specifying the window you  want \n");
  309.  
  310.  
  311.             locate_window(temp,18,15);
  312.             print_window(temp,"Press any key to continue...");
  313.             color_window(temp,foreground(14),0);
  314.             key=getch();
  315.             close_window(temp);
  316.  
  317.             break;
  318.         case(12):
  319.  
  320.             color(foreground(14),0);
  321.             temp=open_window(4,9,23,73);
  322.             color_window(temp,foreground(2),0);
  323.  
  324.             print_window(temp," this to take place in. \n");
  325.  
  326.             print_window(temp,"\n C-WINDOWS  has  a  default maximum setting of 255 windows at ");
  327.             print_window(temp,"\n one time.  This can be changed easily to a greater or lessor ");
  328.             print_window(temp,"\n amount by recompiling the source.  C-WINDOWS treats  windows ");
  329.             print_window(temp,"\n in  the same manor as the Macintosh and LISA computers.  You ");
  330.             print_window(temp,"\n can open windows in layers on top of  each  other  and  then ");
  331.             print_window(temp,"\n re-activate  a  window  which  is  in  the  middle of or the ");
  332.             print_window(temp,"\n bottom.  C-WINDOWS will restore any text under  the  windows ");
  333.             print_window(temp,"\n when they are opened, closed or re-activated.\n"); 
  334.  
  335.             print_window(temp,"\n To  use  the C-WINDOWS functions,  all you have to do is put ");
  336.             print_window(temp,"\n the code in your program which make